<template>
    <button id="command" @click="draw">绘制</button>
</template>

<script setup>
import { onMounted } from 'vue';
import * as Cesium from 'cesium'

const props = defineProps({
    viewer: {
        type: Object,
    }
})

const draw = () => {
    try {
        let handler = new Cesium.ScreenSpaceEventHandler(props.viewer.scene.canvas);
        handler.setInputAction(() => {
            console.log('左击')
        }, Cesium.ScreenSpaceEventType.LEFT_CLICK)
    } catch (e) {
        console.error(new Error(e));
    }
}




</script>

<style scoped>
#command {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgb(88, 88, 88);
    z-index: 5;
}
</style>